# +----------------------------------------------------------------------
# | ChatWork
# +----------------------------------------------------------------------
# | 这不是一个自由软件,您只能在不用于商业目的的前提下对程序代码进行修改和使用。
# | 任何企业和个人不允许对程序代码以任何形式任何目的再发布,商业使用请获取授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from typing import List, Dict
from pydantic import BaseModel, Field
from fastapi import Query


class ChatRoomingBotIn(BaseModel):
    """ 智脑编号参数 """
    bot: str = Query(..., min_length=1, max_length=32, description="智能体编号")

    class Config:
        json_schema_extra = {
            "example": {
                "code": "HCxiS50KZ0s3BcdF"
            }
        }


"""--------------- Separator ---------------"""


class ChatRoomingListVo(BaseModel):
    """ 窗口列表Vo """
    code: str = Field(description="智能体编号")
    logo: str = Field(description="智能体图标")
    name: str = Field(description="智能体名称")
    intro: str = Field(description="智能体简介")

    class Config:
        json_schema_extra = {
            "example": {
                "code": "HCxiS50f0d4nd",
                "logo": "https://www.waitadmin.cn/bot.png",
                "name": "智能体名称",
                "intro": "智能体简介"
            }
        }


class ChatRoomingInitVo(BaseModel):
    """ 窗口详情Vo """
    code: str = Field(description="智能体编号")
    logo: str = Field(description="智能体图标")
    name: str = Field(description="智能体名称")
    intro: str = Field(description="智能体简介")
    welcome_text: str = Field(description="欢迎光临词")
    collect_num: int = Field(description="收藏数量")
    is_collect: bool = Field(description="是否收藏")
    is_web_search: bool = Field(description="联网搜索启用")
    max_upload_num: int = Field(description="最大上传数")
    is_upload_files: bool = Field(description="文档上传")
    is_upload_image: bool = Field(description="图片上传")
    is_show_timed: bool = Field(description="显示耗时")
    is_show_quote: bool = Field(description="显示引用")
    is_show_context: bool = Field(description="显上下文")
    instruct: List[Dict[str, str]] = Field(description="建议指令")

    class Config:
        json_schema_extra = {
            "example": {
                "code": "pdr4ahpnbs0ulhti",
                "logo": "http://0.0.0.0:8200/static/images/default_robot.png",
                "name": "通用智能助手",
                "intro": "",
                "welcome_text": "",
                "collect_num": 10,
                "is_collect": False,
                "is_web_search": False,
                "max_upload_num": 1,
                "is_upload_files": True,
                "is_upload_image": True,
                "is_show_timed": True,
                "is_show_quote": True,
                "is_show_context": True,
                "instruct": [
                    {
                        "name": "帮我写作",
                        "content": "帮我写一首关于春天的诗"
                    }
                ]
            }
        }
